home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / factor < prev    next >
Internet Message Format  |  1995-03-31  |  1KB

  1. From helens!shelby!rutgers!tut.cis.ohio-state.edu!uc!norge.unet.umn.edu!fin Fri May 25 01:21:31 PDT 1990
  2. Status: RO
  3.  
  4. Article 1740 of comp.sys.handhelds:
  5. Path: helens!shelby!rutgers!tut.cis.ohio-state.edu!uc!norge.unet.umn.edu!fin
  6. >From: fin@norge.unet.umn.edu (Craig A. Finseth)
  7. Newsgroups: comp.sys.handhelds
  8. Subject: Prime Factorizer for the HP-48SX
  9. Message-ID: <1833@uc.msc.umn.edu>
  10. Date: 24 May 90 20:55:46 GMT
  11. Sender: news@uc.msc.umn.edu
  12. Organization: Univ Netw Serv, Univ of Minn
  13. Lines: 33
  14.  
  15.  
  16. Written by: Lauren Nelson
  17. What: Prime factorizer
  18. When: 10 May 1990
  19.  
  20. PRIME    Stack Input:    real number
  21.     Stack Output:    list containing the input's prime factors
  22.  
  23. Checksum: #47966d
  24. Size: 192
  25. ------------------------------------------------------------
  26. %%HP: T(3)A(D)F(.);
  27. \<< { } SWAP
  28.   WHILE DUP 2 MOD 0
  29. ==
  30.   REPEAT 2 / SWAP 2
  31. + SWAP
  32.   END DUP \v/ 1 1 ROT
  33.   START 2 +
  34.     WHILE DUP2 MOD
  35. 0 ==
  36.     REPEAT DUP 4
  37. ROLL SWAP + ROT ROT
  38. DUP ROT SWAP / SWAP
  39.     END 2
  40.   STEP ROT ROT DUP
  41. 1
  42.   IF ==
  43.   THEN DROP SWAP
  44. DROP
  45.   ELSE + SWAP DROP
  46.   END
  47. \>>
  48.  
  49.  
  50.